<template>
  <div class="settings">
    <template>
      <el-tabs class="settings-tabs maxW" v-model="activeName2" type="card">
        <el-tab-pane label="账号绑定" name="1">
          <account />
        </el-tab-pane>
        <el-tab-pane label="基本信息" name="2">
          <info />
        </el-tab-pane>
        <el-tab-pane label="修改密码" name="3">
          <password />
        </el-tab-pane>
        <el-tab-pane label="人脸采集" name="4" v-if="isShow==='yes'&&(userRole.indexOf(4)>-1||userRole.indexOf(6)>-1)">
          <collect />
        </el-tab-pane>
      </el-tabs>
    </template>
  </div>
</template>
<script>
import account from './bindAccount';
import info from './baseInfo';
import password from './changePassword';
import collect from './faceCollection';
export default {
  components: {
    account, info, password, collect
  },
  data() {
    return {
      activeName2: '1',
      userRole: this.$store.getters.userInfo.role,
      isShow:"no"
    }
  },
  created() {
  },
  mounted() {
    this.checkShow();
  },
  methods: {
    // 判断是否显示人脸采集页面
    checkShow(){
      let success = res => {
         this.isShow=res.data;
      };
      this.$ajax({
        url: "api/app/check_ai",
        method: "get",
        params: {

        },
        func: { success: success }
      });
    }
  }
}
</script>
